from abc import ABC, abstractmethod
from typing import List

__all__ = ["Command", "NoCommand", "MacroCommand"]

class Command(ABC):
    @abstractmethod
    def execute(self):
        ...

    @abstractmethod
    def undo(self):
        ...


class NoCommand(Command):
    def execute(self):
        pass

    def undo(self):
        pass


class MacroCommand(Command):
    def __init__(self, commands: List[Command]):
        self._commands = commands

    def execute(self):
        for i in self._commands:
            i.execute()

    def undo(self):
        for i in reversed(self._commands):
            i.undo()